<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>xiarikui管理后台</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link href="/Public/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/Public/bootstrap/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="/Public/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <link href="/Public/dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
    <link href="/Public/plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css" />
    <link href="/Public/Admin/css/unify.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="/Public/images/favicon.ico" type="image/x-icon" />
    <script src="/Public/js/jQuery-2.1.4.min.js"></script>
    <script src="/Public/js/global.js"></script>
    <script src="/Public/js/myFormValidate.js"></script>
    <script src="/Public/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/Public/js/layer/layer-min.js"></script>
    <script src="/Public/js/myAjax.js"></script>
    <script type="text/javascript">
    function delfunc(obj) {
        layer.confirm('确认删除？', {
            btn: ['确定', '取消']
        }, function() {
            $.ajax({
                type: 'post',
                url: $(obj).attr('data-url'),
                data: {
                    act: 'del',
                    del_id: $(obj).attr('data-id')
                },
                dataType: 'json',
                success: function(data) {
                    if (data == 1) {
                        layer.msg('操作成功', {
                            icon: 1
                        });
                        $(obj).parent().parent().remove();
                    } else {
                        layer.msg(data, {
                            icon: 2,
                            time: 2000
                        });
                    }
                    layer.closeAll();
                }
            });
        }, function(index) {
            layer.close(index);
            return false;
        });
    }

    //全选
    function selectAll(name, obj) {
        $('input[name*=' + name + ']').prop('checked', $(obj).checked);
    }

    function get_help(obj) {
        layer.open({
            type: 2,
            title: '',
            shadeClose: true,
            shade: 0.3,
            area: ['90%', '90%'],
            content: $(obj).attr('data-url')
        });
    }

    function delAll(obj, name) {
        var a = [];
        $('input[name*=' + name + ']').each(function(i, o) {
            if ($(o).is(':checked')) {
                a.push($(o).val());
            }
        });
        if (a.length == 0) {
            layer.alert('请选择删除项', {
                icon: 2
            });
            return;
        }
        layer.confirm('确认删除？', {
            btn: ['确定', '取消']
        }, function() {
            $.ajax({
                type: 'get',
                url: $(obj).attr('data-url'),
                data: {
                    act: 'del',
                    del_id: a
                },
                dataType: 'json',
                success: function(data) {
                    if (data == 1) {
                        layer.msg('操作成功', {
                            icon: 1
                        });
                        $('input[name*=' + name + ']').each(function(i, o) {
                            if ($(o).is(':checked')) {
                                $(o).parent().parent().remove();
                            }
                        });
                    } else {
                        layer.msg(data, {
                            icon: 2,
                            time: 2000
                        });
                    }
                    layer.closeAll();
                }
            });
        }, function(index) {
            layer.close(index);
            return false;
        });
    }
    </script>
    <style type="text/css">
        .table > thead:first-child > tr:first-child > th{
            border-bottom: 0 none;
        } 
    </style>
</head>

<body>

<div class="wrapper">
    <div class="breadcrumbs" id="breadcrumbs">
    <ol class="breadcrumb">
        <?php if(is_array($navigate_admin)): foreach($navigate_admin as $k=>$v): ?><li><?php echo ($k); ?></li><?php endforeach; endif; ?>
    </ol>
</div>

    <section class="content">
        <div class="container-fluid">

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i> 账户资金记录列表</h3>
                </div>
                <form action="" id="search-form2" class="navbar-form form-inline" method="post" >
                <div class="panel-body">

                        <div class="form-group">
                            <label class="control-label" for="input-user_id">会员id</label>
                            <div class="input-group">
                                <input type="text" name="user_id" value="<?php echo ($user_id); ?>" placeholder="会员id" id="input-user_id" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-nickname">　用户名称</label>
                            <div class="input-group">
                                <input type="text" name="username" value="<?php echo ($post["username"]); ?>" placeholder="昵称" id="input-nickname" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-mobile">　手机号码</label>
                            <div class="input-group">
                                <input type="text" name="mobile" value="<?php echo ($post["mobile"]); ?>" placeholder="手机号码" id="input-mobile" class="form-control">
                                <!--<span class="input-group-addon" id="basic-addon2"><i class="fa fa-search"></i></span>-->
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="control-label" for="input-order-id">类型选择</label>
                            <div class="input-group">
                                <select name="type" class="form-control">
                                    <option value="">请选择</option>
                                    <?php if(is_array($type)): $i = 0; $__LIST__ = $type;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($key); ?>"
                                        <?php if($post["type"] == $key): ?>selected<?php endif; ?>><?php echo ($vo); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>
                            </div>
                        </div>


                        <div class="form-group">
                            <button type="submit" onclick="$('#search-form2').attr('action','');$('#search-form2').submit();" id="button-filter search-order" class="btn btn-primary pull-right"><i class="fa fa-search"></i> 筛选</button>
                        </div>

                        <button type="button" onclick="$('#search-form2').attr('action','<?php echo U('user/export_userlog');?>');$('#search-form2').submit();" class="btn btn-default pull-right" style = "margin-top:5px"><i class="fa fa-file-excel-o"></i>&nbsp;导出excel</button>



                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                                <tr>
                                    <th style="width: 1px;" class="text-center">
                                        <input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);">
                                    </th>
                                    <th class="text-center">
                                        ID
                                    </th>
                                    <th class="text-center">
                                        用户名称
                                    </th>
                                    <th class="text-center">
                                        用户手机
                                    </th>
                                    <th class="text-center">
                                        操作
                                    </th>
                                    <th class="text-center">
                                        金额
                                    </th>
                                    <th class="text-center">
                                        支付状态
                                    </th>
                                    <th class="text-center">
                                        交易单号
                                    </th>
                                    <th class="text-center">
                                        商户单号
                                    </th>
                                    <th class="text-center">
                                        支付时间
                                    </th>
                                    <th class="text-center">
                                        生成时间
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php if(is_array($lists)): $i = 0; $__LIST__ = $lists;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$list): $mod = ($i % 2 );++$i;?><tr>

                                        <td class="text-center">
                                            <input type="checkbox" name="selected[]" value="<?php echo ($list["id"]); ?>">
                                        </td>

                                        <td class="text-left "><?php echo ($list["id"]); ?></td>
                                        <td class="text-left "><?php echo ($list["username"]); ?></td>
                                        <td class="text-left "><?php echo ($list["mobile"]); ?></td>
                                        <td class="text-left">
                                            <?php echo ($type[$list[type]]); ?>
                                        </td>
                                        <td class="text-right">
                                            <?php echo ($list["money"]); ?>
                                        </td>
                                        <td class="text-center"><?php if($list["status"] == 1): ?>成功<?php else: ?><font color="red">失败</font><?php endif; ?></td>
                                        <td class="text-right">
                                            <?php echo ($list["trade_sn"]); ?>
                                        </td>
                                        <td class="text-right">
                                            <?php echo ($list["shop_sn"]); ?>
                                        </td>
                                        <td class="text-center"><?php echo (date("Y-m-d H:i",$list["pay_time"])); ?></td>
                                        <td class="text-center"><?php echo (date("Y-m-d H:i",$list["add_time"])); ?></td>
                                    </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                            </tbody>
                        </table>

                        <div class="pull-right">
                            <?php echo ($page); ?>
                        </div>
                    </div>

                </div>
                </form>
            </div>
        </div>
    </section>
</div>